{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">选择赛事：</label>
                            <div class="layui-input-block">
                                <select name="nt_two" xm-select="select1" xm-select-max="2" xm-select-search="" xm-select-search-type="dl" lay-verify="required">
                                    <option value="" >---请选择（最多选两个）---</option>
                                    {foreach name="datas" item="v"}
                                    <option value="{$v.mf_fj_matchid}" xm-form-selected="" {if $info.nt_one==$v.mf_fj_matchid || $info.nt_two==$v.mf_fj_matchid}selected='selected'{/if}>
                                        {$v.mf_name}({$v.mf_match_time}){$v.mf_home_name_cn} vs {$v.mf_away_name_cn}
                                    </option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <input type="hidden" value="{$info.nt_id}" name="nt_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('setMatch')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
